/*
 * Copyright (c) 2006-2021, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2025-05-13     Administrator       the first version
 */
#ifndef HARDWARE_MOTOR_H_
#define HARDWARE_MOTOR_H_

#include "system.h"

/*宏定义PWM接口，12为左前和左后的，5为右前和右后的*/
#define PWM_DEV_NAME12 "pwm12"
#define PWM_DEV_NAME5 "pwm5"
#define Left_ahead_AIN1  GET_PIN(E,  0)
#define Left_ahead_AIN2  GET_PIN(E,  1)
#define Left_back_BIN1 GET_PIN(E,  2)
#define Left_back_BIN2 GET_PIN(E,  3)
#define right_ahead_AIN1 GET_PIN(E,  4)
#define right_ahead_AIN2 GET_PIN(E,  5)
#define right_back_BIN1 GET_PIN(E,  6)
#define right_back_BIN2 GET_PIN(E,  7)


#define PERIOD 50000  /*单位为纳秒  50000*/
//#define PWM_DEV_CHAN1 1
//#define PWM_DEV_CHAN2 2
//#define PWM_DEV_CHAN3 3
//#define PWM_DEV_CHAN4 4


int TIM_PWM_init(void);
//初始化电机接口
void Enable_Pin(void);

extern struct rt_device_pwm *pwm_dev5;
extern struct rt_device_pwm *pwm_dev12;

#endif /* HARDWARE_MOTOR_H_ */
